<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">

    $(function() {

        $('#ischeck').combobox({
            url : '',
            panelHeight : 'auto',

            value : '${equtype.ischeck}',
            onChange: function (newValue, oldValue) {
                if(newValue==0)
                {
                    $('#chekrate').combobox('setValues', '0');
                }


            }

        });
        $('#chekrate').combobox({
            url : '',
            panelHeight : 'auto',

            value : '${equtype.chekrate}',


        });
        $('#EquipmenttypeInfo').form({
            url : '${path }/equipmenttype/update',

            onSubmit : function() {
                progressLoad();

                var isValid = $(this).form('validate');


                if (!isValid) {
                    progressClose();
                }

                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });

    });

</script>


    <form id="EquipmenttypeInfo" >

        <input type="hidden" name="id" id="id" value="${equtype.id}"/>
        <div class="form_item">
            <label style="display:inline-block;    width:80px;">设备类型:</label>
            <input type="text" name="equipmenttypename" class="easyui-textbox" required=true validType='length[0, 255]' value="${equtype.equipmenttypename}" />
        </div>
        <div class="form_item">
            <label style="display:inline-block;    width:80px;">是否巡检:</label>

            <select id="ischeck" name="ischeck" style="width: 160px;"  class="easyui-combobox" value="${equtype.ischeck}" >
                <option value="0">不进行巡检</option>
                <option value="1">巡检</option>
            </select>
        </div>
        <div class="form_item">
            <label style="display:inline-block;    width:80px;">巡检频率:</label>
            <select id="chekrate" name="chekrate"  style="width: 160px;"  class="easyui-combobox" value="${equtype.chekrate}"  >
                <option value="0">不巡检</option> <option value="1">每日巡检</option>
                <option value="2">每周巡检</option>
                <option value="3">每月巡检</option>
                <option value="4">每季巡检</option>
                <option value="5">每年巡检</option>
            </select>
        </div>
    </form>
